package com.example.footballsystem.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.footballsystem.entity.Field;
import com.example.footballsystem.entity.PlayerCard;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

import static net.sf.jsqlparser.parser.feature.Feature.insert;

@Mapper
public interface PlayerCardMapper extends BaseMapper<PlayerCard> {
    @Select("select * from playercard")
    public List<PlayerCard> getAllPlayerCard();
    @Select("select  * from playercard where playerName=#{playerName}")
    public List<PlayerCard> getPlayerCardByName(String playerName);
    @Select("select  * from playercard where playerAccount=#{account}")
    public List<PlayerCard> getPlayerCardByAccount(String account);
    @Insert("insert into playercard values " +
            "(#{playerName}," +
            "#{palyerAccount}," +
            "#{playerScores}," +
            "#{role1}," +
            "#{role2}," +
            "#{description}," +
            "#{number}," +
            "#{team}," +
            "#{cteateDate})")
    public Boolean addPlayerCard(PlayerCard playerCard);
    @Delete("delete from playercard where playerAccount=#{playerAccount}")
    public Boolean deletePlayerCard(String playerAccount);
}
